#include "Tree.cpp"

//翻转一棵二叉树。


TreeNode* invertTree(TreeNode* root){
    if (root == NULL) {
        return NULL;
    }

    TreeNode *node = (TreeNode*) malloc(sizeof(TreeNode));
    node->leftChild = invertTree(root->rightChild);
    node->rightChild = invertTree(root->leftChild);
    node->data = root->data;
    return node;
}

int main() {
    Tree tree = CreateTreeByFile("Day-3-1.txt");
    Tree newTree = invertTree(tree);
}